package com.fmx.BookStore.service.impl;

import com.fmx.BookStore.domain.Book;
import com.fmx.BookStore.mapper.BookMapper;
import com.fmx.BookStore.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements IBookService {

    @Autowired
    private BookMapper bookMapper;
    @Override
    public Book getBookById(Long bookId) {
        return bookMapper.getBookById(bookId);
    }

    @Override
    public List<Book> listBook(Book book) {
        return bookMapper.listBook(book);
    }

    @Override
    public int insertBook(Book book) {
        return bookMapper.insertBook(book);
    }

    @Override
    public int updateBook(Book book) {
        return bookMapper.updateBook(book);
    }

    @Override
    public int deleteBook(Long bookId) {
        return bookMapper.deleteBook(bookId);
    }
}
